<template>
  <div class="hospital-list-content-item-wrap">
    <div class="hospital-list-content-item-photo-wrap" @click="jumpHospitalDetails">
      <img
        :src="hospitalDatas.user_photo"
        class="hospital-list-content-item-photo"
      >
      <img
        src="~assets/img/authentication.png"
        alt=""
        class="hospital-list-content-item-photo-authentication"
      >
    </div>
    <div class="hospital-list-content-item-data">
      <div class="hospital-list-content-item-data-wrap">
        <div class="hospital-item-content-left" @click="jumpHospitalDetails">
          <div class="hospital-list-content-item-name">
            {{ hospitalDatas.user_name }}
            <img
              src="~assets/img/medicine-authentication.png"
              class="hospital-list-content-item-authentication"
            >
          </div>
          <div class="hospital-list-content-item-address">
            地址：{{ hospitalDatas.user_address }}
          </div>
        </div>
        <div class="hospital-item-content-right">
          <div class="hospital-item-content-right-details" @click="jumpHospitalDetails">
            <div class="hospital-item-content-right-details-icon" />
            <div class="hospital-item-content-right-details-text">
              查看详情
            </div>
          </div>
          <div class="hospital-item-content-right-consultation" @click="jumpAboutUs">
            <div class="hospital-item-content-right-consultation-icon" />
            <div class="hospital-item-content-right-consultation-text">
              免费咨询
            </div>
          </div>
        </div>
      </div>
      <div class="hospital-list-content-item-num">
        <div v-if="hospitalDatas.user_statistic.case!=0" class="hospital-list-content-item-case">
          日记 <span>{{ hospitalDatas.user_statistic.case }}</span>篇
        </div>
        <div class="hospital-list-content-item-place_total">
          预约 <span>{{ hospitalDatas.user_statistic.place_total }}</span>个
        </div>
      </div>
      <div class="hospital-item-content-product">
        <div
          v-if="hospitalDatas.hospital_service.list.length>=1"
          class="hospital-item-content-product-one"
          @click="jumpProductDetails(hospitalDatas.hospital_service.list[0].product_id)"
        >
          <div class="hospital-item-content-product-one-name-wrap">
            <div class="hospital-item-content-product-one-icon" />
            <div class="hospital-item-content-product-one-product_name">
              {{ hospitalDatas.hospital_service.list[0].product_name }}
            </div>
          </div>

          <div class="hospital-item-content-product-one-price">
            ￥{{ hospitalDatas.hospital_service.list[0].package.sale.selling_price }}
          </div>
        </div>
        <div
          v-if="hospitalDatas.hospital_service.list.length>=2"
          class="hospital-item-content-product-two"
          @click="jumpProductDetails(hospitalDatas.hospital_service.list[1].product_id)"
        >
          <div class="hospital-item-content-product-two-name-wrap">
            <div class="hospital-item-content-product-two-icon" />
            <div class="hospital-item-content-product-two-product_name">
              {{ hospitalDatas.hospital_service.list[1].product_name }}
            </div>
          </div>
          <div class="hospital-item-content-product-two-price">
            ￥{{ hospitalDatas.hospital_service.list[1].package.sale.selling_price }}
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  components: {

  },
  props: {
    hospitalDatas: {
      type: Object,
      default: () => { }
    }
  },
  data() {
    return {

    }
  },
  computed: {

  },
  created() {

  },
  mounted() {

  },
  methods: {
    jumpHospitalDetails() {
      this.$router.push(`/hospital/${this.hospitalDatas.user_id}`)
    },
    jumpAboutUs() {
      this.$router.push('/aboutus')
    },
    jumpProductDetails(i) {
      this.$router.push(`/product/${i}`)
    }
  }
}
</script>
<style scoped lang="scss">
.hospital-list-content-item-wrap {
  display: flex;
  margin-top: 10px;
}
.hospital-list-content-item-data-wrap{
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.hospital-list-content-item-photo-wrap:hover{
  cursor: pointer;
}
.hospital-list-content-item-photo-wrap {
  width: 80px;
  height: 80px;
  position: relative;
  margin-top: 8px;
  .hospital-list-content-item-photo {
    width: 80px;
    height: 80px;
  }
  .hospital-list-content-item-photo-authentication {
    width: 13px;
    height: 14px;
    position: absolute;
    bottom: 0;
    right: 0;
  }
}
.hospital-list-content-item-data {
  width: 100%;
  margin-left: 10px;
  margin-top: 8px;
  .hospital-list-content-item-name {
    font-size: 16px;
    font-weight: 600;
    color: rgba(51, 51, 51, 1);
    line-height: 22px;
    .hospital-list-content-item-authentication {
      width: 33px;
      height: 14px;
    }
  }
  .hospital-list-content-item-address {
    font-size: 12px;
    font-weight: 400;
    color: rgba(153, 153, 153, 1);
    line-height: 17px;
    margin-top: 5px;
  }
  .hospital-list-content-item-num {
    display: flex;
    margin-top: 17px;
    .hospital-list-content-item-case {
      width: 80px;
      height: 20px;
      background: rgba(245, 245, 245, 1);
      border-radius: 10px;
      font-size: 12px;

      font-weight: 400;
      color: rgba(102, 102, 102, 1);
      line-height: 20px;
      text-align: center;
      > span {
        color: #333;
      }
    }
    .hospital-list-content-item-place_total {
      width: 96px;
      height: 20px;
      background: rgba(245, 245, 245, 1);
      border-radius: 10px;
      font-size: 12px;

      font-weight: 400;
      color: rgba(102, 102, 102, 1);
      line-height: 20px;
      text-align: center;
      margin-left: 12px;
      > span {
        color: #333;
      }
    }
  }
}
.hospital-item-content-product{
  margin-top: 9px;
  padding-right: 22px;
}
.hospital-item-content-product-one{
  width: 100%;
  height: 50px;
  border-top: 1px solid rgba(240,240,240,1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  .hospital-item-content-product-one-icon{
    width: 18px;
    height: 18px;
    background: url('~assets/img/buy.png') center center no-repeat;
    background-size: 100% 100%;
  }
  .hospital-item-content-product-one-product_name{
    width: 1000px;
    font-size:14px;
    font-family:PingFangSC-Regular,PingFang SC;
    font-weight:400;
    color:rgba(51,51,51,1);
    line-height:20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hospital-item-content-product-one-price{
    font-size:14px;
    font-family:PingFangSC-Regular,PingFang SC;
    font-weight:400;
    color:rgba(255,0,69,1);
    line-height:20px;
  }
}
.hospital-item-content-product-one:hover{
  cursor: pointer;
}
.hospital-item-content-product-two{
  width: 100%;
  height: 50px;
  border-top: 1px solid rgba(240,240,240,1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  .hospital-item-content-product-two-icon{
    width: 18px;
    height: 18px;
    background: url('~assets/img/buy.png') center center no-repeat;
    background-size: 100% 100%;
  }
  .hospital-item-content-product-two-product_name{
     width: 656px;
    font-size:14px;
    font-family:PingFangSC-Regular,PingFang SC;
    font-weight:400;
    color:rgba(51,51,51,1);
    line-height:20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hospital-item-content-product-two-price{
    font-size:14px;
    font-family:PingFangSC-Regular,PingFang SC;
    font-weight:400;
    color:rgba(255,0,69,1);
    line-height:20px;
  }
}
.hospital-item-content-product-two:hover{
  cursor: pointer;
}

.hospital-item-content-right {
  display: flex;
  margin-right: 22px;
  .hospital-item-content-right-details:hover{
    cursor: pointer;
    background: rgba(246, 246, 246, 1);
  }
  .hospital-item-content-right-details {
    margin-right: 30px;
    width: 59px;
    height: 59px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    .hospital-item-content-right-details-icon {
      width: 23px;
      height: 23px;
      background: url("~assets/img/query-icon.png") center center no-repeat;
      background-size: 100% 100%;
      margin: 0 auto;
    }
    .hospital-item-content-right-details-text {
      font-size: 12px;

      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      line-height: 17px;
    }
  }
  .hospital-item-content-right-consultation:hover {
      cursor: pointer;
      background: rgba(246, 246, 246, 1);
    }
  .hospital-item-content-right-consultation {
    width: 59px;
    height: 59px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    .hospital-item-content-right-consultation-icon {
      width: 23px;
      height: 23px;
      background: url("~assets/img/consultation-icon.png") center center
        no-repeat;
      background-size: 100% 100%;
      margin: 0 auto;
    }
    .hospital-item-content-right-consultation-text {
      font-size: 12px;

      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      line-height: 17px;
    }
  }
}
.hospital-item-content-left:hover{
  cursor: pointer;
}

.hospital-item-content-product-one-name-wrap{
  display: flex;
}
.hospital-item-content-product-two-name-wrap{
  display: flex;
}
</style>
